package com.jml.jdk8.bifunction复杂案例;


import java.math.BigDecimal;
import java.util.function.Predicate;
import org.junit.Test;

/**
 * @author:jml
 * @date: 2020/2/9 0009 13:38
 * @description：
 */
public class PredicareTest001 {

    /**
     * Predicate.isEqual对数据的比较，相同类型比较相等
     * BigDecimal直接比较需要括号里的类型一致才可以相等
     */
    @Test
    public void  t0(){
        Integer integer1 = new Integer(2);
        Integer integer2 = new Integer(2);
        boolean test = Predicate.isEqual(integer1).test(integer2);
        System.out.println(test);

        Long Long1 = new Long(2);
        Long Long2 = new Long(2);
        boolean test1 = Predicate.isEqual(Long1).test(Long2);
        System.out.println(test1);


        BigDecimal BigDecimal1 = new BigDecimal("100000.01");
        BigDecimal BigDecimal2 = new BigDecimal("100000.01");
        boolean test2 = Predicate.isEqual(BigDecimal1).test(BigDecimal2);
        System.out.println(test2);
        System.out.println(BigDecimal1.equals(BigDecimal2));

        Long Long3 = new Long(100000L);
        BigDecimal BigDecimal3 = new BigDecimal("100000");
        boolean testz2 = Predicate.isEqual(Long3).test(BigDecimal3);
        System.out.println(testz2);
        System.out.println(Long3.equals(BigDecimal3));

        PredicareTest001 PredicareTest0011 = new PredicareTest001();
        PredicareTest001 PredicareTest0012 = new PredicareTest001();
        boolean test3 = Predicate.isEqual(PredicareTest0011).test(PredicareTest0012);
        System.out.println(test3);
    }


}
